﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;
using xml_classes;

namespace QuestPrototype
{
    class UserInput
    {
        public static GameMouseState Update(GameScreen gameScreen)
        {
            MouseState mouseState = Mouse.GetState();

            GameMouseState gameMouseState = new GameMouseState();

            gameMouseState.Position = new Vector2(mouseState.X, mouseState.Y);
            gameMouseState.LeftButtonPressed = gameMouseState.LeftButtonPressed;
            gameMouseState.RightButtonPressed = gameMouseState.RightButtonPressed;
            gameMouseState.ContainingPolygons = new List<Polygon>();
            foreach (Polygon pol in gameScreen.Polygons1)
            {
                if (pol.contains(gameMouseState.Position))
                {
                    gameMouseState.ContainingPolygons.Add(pol);
                }
            }

            return gameMouseState;
        }
    }

    class GameMouseState
    {
        public List<Polygon> ContainingPolygons;
        public Boolean LeftButtonPressed;
        public Boolean RightButtonPressed;
        public Vector2 Position;
    }
}